﻿using Assets.Scripts.DL.Consts;
using Assets.Scripts.DL.Mgrs;

public class PlayerHurt : PlayerBaseState {
	public PlayerHurt(PlayerController controller, PlayerStateEnum stateName, State<PlayerStateEnum> superFSM, StateFactory<PlayerStateEnum> factory) : base(controller, stateName, superFSM, factory) {
		AddConditionToSelf(() => _controller.StateData.IsHurt);
	}

	public override void Enter() {
		_controller.PlayAnim(PlayerStateEnum.Hurt);
		AudioManager.Play(_controller.StateAudio, AudioStr.PlayerHurt3Audio);
	}
	public override void Update() {
		base.Update();
		if (_controller.IsAnimPlayOver()) {
			_controller.StateData.IsHurt = false;
			_controller.StateData.IsSpecial = false;
		}
	}

	public override void Exit() {
	}
}